package com.multimedia.scala.euler
import com.multimedia.scala.TailRecTest._
object Asd53 {
    def main(args : Array[String]) : Unit = {
    	//1-st caching factorials
        val fs = (0 to 100).map(BigInt(_)).map(factorialBig(_))
        
        def combinations(r: Int, n: Int): BigInt = fs(n)/(fs(r)*fs(n-r))
        
        println((1 to 100).map(r=>{
            (r to 100).count(combinations(r, _)>1000000)
        }).sum)
    }
}
